package com.lagou.homework;

import java.io.IOException;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;


public class HwMapper extends Mapper<LongWritable, Text, IntWritable, IntWritable> {
    IntWritable k = new IntWritable();

    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        // 1 获取一行
        String word = value.toString();
        // 2 输出
        k.set(new Integer(word));
        context.write(k, new IntWritable(1));
    }
}


